import fetch from 'utils/fetch';
/**
 * 学校管理
 */
//查询所有学校类型
export function listSchoolType() {
    const data = {

    };
    return fetch({
        url: '/school/listSchoolType',
        method: 'post',
        data
    });
}
//根据名称模糊查询科目
export function listSubject(name) {
    const data = {
        name
    };
    return fetch({
        url: '/school/listSubject',
        method: 'post',
        data
    });
}
//根据名称模糊查询学校名称
export function listSchoolByName(schoolName) {
    const data = {
        schoolName
    };
    return fetch({
        url: '/school/listSchoolByName',
        method: 'post',
        data
    });
}

//开启或关闭短信功能
export function updateSchoolOwnerStatus(schoolId, id, status) {
    const data = {
        schoolId,
        id,
        status
    };
    return fetch({
        url: '/school/updateSchoolOwnerStatus',
        method: 'post',
        data
    });
}
//科目详情
export function listSubjectBySchoolId(schoolId) {
    const data = {
        schoolId
    };
    return fetch({
        url: '/school/listSubjectBySchoolId',
        method: 'post',
        data
    });
}
//修改学校
export function updateSchoolByCondition(schoolId, provinceId, cityId, areaId, detail) {
    const data = {
        schoolId,
        provinceId,
        cityId,
        areaId,
        detail
    };
    return fetch({
        url: '/school/updateSchoolByCondition',
        method: 'post',
        data
    });
}
//查询学校负责人
export function listSchoolOwnerBySchoolId(schoolId) {
    const data = {
        schoolId
    };
    return fetch({
        url: '/school/listSchoolOwnerBySchoolId',
        method: 'post',
        data
    });
}
//添加学校负责人
export function saveSchoolOwner(phone, name, schoolId, sIdentityId) {
    const data = {
        phone,
        name,
        schoolId,
        sIdentityId
    };
    return fetch({
        url: '/school/saveSchoolOwner',
        method: 'post',
        data
    });
}
//初始化密码
export function updatePassword(id, phone) {
    const data = {
        id,
        phone
    };
    return fetch({
        url: '/school/updatePassword',
        method: 'post',
        data
    });
}
//修改负责人
export function updateSchoolOwner(phone, name, id, sIdentityId) {
    const data = {
        phone,
        name,
        id,
        sIdentityId
    };
    return fetch({
        url: '/school/updateSchoolOwner',
        method: 'post',
        data
    });
}
//根据条件分页查询学校
export function listSchoolByPage(curPage, pageSize, provinceId, cityId, areaId, schoolId, schoolType, ownerName, ownerPhone) {
    const data = {
        curPage,
        pageSize,
        provinceId,
        cityId,
        areaId,
        schoolId,
        schoolType,
        ownerName,
        ownerPhone
    };
    return fetch({
        url: '/school/listSchoolByPage',
        method: 'post',
        data
    });
}
//删除学校
export function batchDeleteSchool(schoolId) {
    const data = {
        schoolId
    };
    return fetch({
        url: '/school/batchDeleteSchool',
        method: 'post',
        data
    });
}
//删除学校负责人
export function removeSchoolOwner(schoolId, id) {
    const data = {
        schoolId,
        id
    };
    return fetch({
        url: '/school/removeSchoolOwner',
        method: 'post',
        data
    });
}
//添加科目
export function updateSubject(schoolId, subjectId) {
    const data = {
        schoolId,
        subjectId
    };
    return fetch({
        url: '/school/updateSubject',
        method: 'post',
        data
    });
}
//修改前查询
export function getSchoolInfo(schoolId) {
    const data = {
        schoolId
    };
    return fetch({
        url: '/school/getSchoolInfo',
        method: 'post',
        data
    });
}